<script setup>
import config from './config'
import {
	getToken
} from '@/utils/auth'
import {
	useConfigStore,
	useUserStore
} from '@/store'
import {
	onLaunch
} from '@dcloudio/uni-app'
import { onBeforeUnmount } from 'vue'


onLaunch(() => {
	initApp()
})

onBeforeUnmount(() => {
	// 清除获取进行中运单定时器
	useUserStore().clearGetWaybillTimer()
})

// 初始化应用
const initApp = () => {
	// 初始化应用配置
	initConfig()
	// 设置获取进行中运单定时器
	useUserStore().setGetWaybillTimer()
}

const initConfig = () => {
	useConfigStore().setConfig(config)
}
</script>

<style lang="scss">
@import "uview-plus/index.scss";
@import '@/static/scss/index.scss';
</style>